<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理--试卷编辑</title>
<link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function trim(str){
	return str.replace(/^\s+|\s+$/,"");
}
function check(form){
    if(trim(form.name.value)==""){
        alert("课程名不能为空");
        return false;
    }

	if(form.industryId.value==0){
		alert("您还未选择行业");
		return false;
	}
    if(rim(form.img.value)=="" ){
        alert("价格为空");
        return false;
    }
    if(rim(form.openTime.value)=="" ){
        alert("开放时间为空");
        return false;
    }
//	if(trim(form.intro.value)==""){
//		alert("介绍不能为空");
//		return false;
//	}
	if(trim(form.img.value)==""){
		alert("封面图不能为空");
		return false;
	}

	<c:if test="${not empty clazzEntity}">
		form.action="<c:url value="/admin/clazzadd?m=doedit"/>";
	</c:if>
	return true;
}
function changeselect(){
//    var industryId= $("#industryId").val();
//    alert(industryId);
}
</script>
</head>
<body>
<div class="content">
<jsp:include page="../pub/top.jsp"></jsp:include>
<!--头部结束-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="left" valign="top">
<jsp:include page="../pub/left_clazz.jsp"></jsp:include>
</td>
<td valign="top">
	<div class="right">
	<form action="<c:url value="/admin/clazzadd?m=dopub"/>" method="post" onsubmit="return check(this)" enctype="multipart/form-data" style="margin:0">
	<table width="80%" border="0" cellpadding="0" cellspacing="1" bgcolor="#d1d5d8">
	<tr>
	<td height="28" colspan="2" bgcolor="#c6dbf8" class="biaoti" style="padding:0;">
        试卷编辑
	</td>
	</tr>


        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>所属课程：</td>
            <td height="28" bgcolor="#FFFFFF">
                <select id="industryId" name="industryId" style="width:100px;" onchange="changeselect()">
                    <option value="0">所属课程</option>
                    <c:forEach items="${industryList}" var="industry">
                        <option value="${industry.name}" ${industry.name==param.industryId?'selected=selected':''}><c:out value="${industry.value}"/></option>
                    </c:forEach>
                </select>
            </td>
        </tr>

        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>题目类型：</td>
            <td height="28" bgcolor="#FFFFFF">
                <select id="industryId" name="industryId" style="width:100px;" onchange="changeselect()">
                    <option value="0">章节</option>
                    <c:forEach items="${industryList}" var="industry">
                        <option value="${industry.name}" ${industry.name==param.industryId?'selected=selected':''}><c:out value="${industry.value}"/></option>
                    </c:forEach>
                </select>

            </td>
        </tr>
        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>答题类型：</td>
            <td height="28" bgcolor="#FFFFFF">
                <select id="industryId" name="industryId" style="width:100px;" onchange="changeselect()">
                    <option value="0">单选</option>
                    <c:forEach items="${industryList}" var="industry">
                        <option value="${industry.name}" ${industry.name==param.industryId?'selected=selected':''}><c:out value="${industry.value}"/></option>
                    </c:forEach>
                </select>

            </td>
        </tr>

        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7">题目：</td>
            <td height="28" bgcolor="#FFFFFF">
                <textarea name="intro"><c:out value="${clazzEntity.intro}" escapeXml="false"/></textarea>
                </td>
        </tr>     <tr>
        <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>解析：</td>
        <td height="28" bgcolor="#FFFFFF"><textarea name="intro"><c:out value="${clazzEntity.intro}" escapeXml="false"/></textarea></td>
    </tr>
        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>答案A：</td>
            <td height="28" bgcolor="#FFFFFF">

                <input type="number" name="price" min="1" id="price" value="${clazzEntity.price}"/>
            </td>
        </tr>


        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>答案B：</td>
            <td height="28" bgcolor="#FFFFFF"><input type="number" name="price" min="1" id="price" value="${clazzEntity.price}"/></td>
        </tr>
        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7">答案C：</td>
            <td height="28" bgcolor="#FFFFFF"><input type="number" name="price" min="1" id="price" value="${clazzEntity.price}"/></td>
        </tr>
        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7">答案D：</td>
            <td height="28" bgcolor="#FFFFFF"><input type="number" name="price" min="1" id="price" value="${clazzEntity.price}"/></td>
        </tr>
        <tr>
            <td width="15%" height="28" align="right" bgcolor="#edf1f7"><span>*</span>正确答案：</td>
            <td height="28" bgcolor="#FFFFFF"><input type="number" name="price" min="1" id="price" value="${clazzEntity.price}"/></td>
        </tr>


	</table>
	<div class="anniu">
	<p><input type="submit" value="提交" class="fabu" /> 

	</p>
	<input type="hidden" name="id" value="${clazzEntity.id}"/>
	</div>
	</form>
	</div>
	<br />
	<br />
</td>
</tr>
</table>
<jsp:include page="../pub/foot.jsp"></jsp:include>
</div>

<%--<script type="text/javascript" src="<%=request.getContextPath() %>/fckeditor/fckeditor.js"></script>--%>
<%--<script type="text/javascript">--%>
    <%--var oFCKeditor = new FCKeditor('intro') ;--%>
    <%--oFCKeditor.BasePath	= "${pageContext.request.contextPath}/fckeditor/";--%>
    <%--oFCKeditor.Width="500";--%>
    <%--oFCKeditor.Height="150";--%>
    <%--oFCKeditor.Value="&nbsp;&nbsp;&nbsp;&nbsp;";--%>
    <%--oFCKeditor.ToolbarSet="classnet";--%>
    <%--oFCKeditor.Config["CustomConfigurationsPath"]="${pageContext.request.contextPath}/fckeditor/myconfig.js?d="+new Date().getTime();--%>
    <%--oFCKeditor.ReplaceTextarea();--%>
<%--</script>--%>


</body>
</html>
